import '../styles/globals.css'

import { useEffect } from 'react'
import type { AppProps } from 'next/app'

function MyApp({ Component, pageProps }: AppProps) {
  useEffect(() => {
    let doc = document.documentElement
    let width = doc.clientWidth
    let ratio = width / 375
    let fontSize = 10 * ratio
    if (fontSize > 20) fontSize = 20
    doc.style.fontSize = fontSize + 'px'
  }, [])

  return <Component {...pageProps} />
}
export default MyApp
